import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: "Home",
    component: () => import('../views/Home.vue')
  },
  {
    path: '/index',
    name: "Index",
    component: () => import('../views/Index'),
    children: [
      {
        path: '/looking',
        name: "Looking",
        component: () => import('../views/Looking')
      },
      {
        path: '/issue',
        name: "Issue",
        component: () => import('../views/Issue')
      },
      {
        path: '/page',
        name: "Page",
        component: () => import('../views/Page'),
      },
      {
        path: '/my',
        name: "My",
        component: () => import('../views/My')
      },
      {
        path: '/news',
        name: 'News',
        component: () => import('../views/News')
      }
    ]
  },

  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login')
  },
  {
    path: '/aks',
    name: "Aks",
    component: () => import('../views/Ask')
  },
  {
    path: '/broker',
    name: "Broker",
    component: () => import('../views/Broker')
  },
  {
    path: '/buy',
    name: "Buy",
    component: () => import('../views/Buy')
  },
  {
    path: '/demand',
    name: "Demand",
    component: () => import('../views/Demand')
  },
  {
    path: '/group',
    name: "Group",
    component: () => import('../views/Group')
  },
  {
    path: '/live',
    name: "Live",
    component: () => import('../views/Live_streaming')
  },
  {
    path: '/mapbuy',
    name: "Mapbuy",
    component: () => import('../views/Map_buy')
  },
  {
    path: '/maprent',
    name: "Maprent",
    component: () => import('../views/Map_rent')
  },
  {
    path: '/message',
    name: "Message",
    component: () => import('../views/Message')
  },
  {
    path: '/real',
    name: "Real",
    component: () => import('../views/Real')
  },
  {
    path: '/renting',
    name: "Renting",
    component: () => import('../views/Renting')
  },
  {
    path: '/house',
    name: "House",
    component: () => import('../views/House')
  },
  {
    path: '/area',
    name: "Area",
    component: () => import('../views/Area')
  },
  {
    path: '/price',
    name: "Price",
    component: () => import('../views/Price')
  },
  {
    path: '/screen',
    name: "Screen",
    component: () => import('../views/Screen')
  },
  {
    path: '/anchor',
    name: "Anchor",
    component: () => import('../views/Anchor')
  },
  {
    path: '/detail/:id',
    name: "Detail",
    component: () => import('../views/Detail')
  },
  {
    path: '/detail_two/:id',
    name: "Detail_two",
    component: () => import('../views/Detail_two/index.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
